<template>
	<view class="content">
		<!-- 海报弹窗 -->
		<view class="cu-modal" :class="{ show: showPoster }" @tap="onClosePoster">
			<view class="cu-dialog" style="background:#feD7AE; height: 1350rpx;">
				<view style="margin-bottom: -50rpx;z-index: 0;">
					保存您的专属海报，分享给好友
				</view>
				<view class="poster-img-box" style="margin-top: 50rpx;">
					<image class="poster-img" :src="posterImage" mode="widthFix"></image>
				</view>
				<view class="poster-btn-box u-flex u-row-between u-col-center" v-show="posterImage">
					<!-- #ifdef APP-PLUS || H5 -->
					<button class="cancel-btn u-reset-button" @tap="sharetoweixin">分享微信</button>
					<button class="save-btn u-reset-button"
						@tap="saveImage">{{ ['wxOfficialAccount', 'H5'].includes(platform) ? '长按图片保存' : '保存图片' }}</button>
					<!-- #endif -->
					<!-- #ifdef MP-WEIXIN -->
					<button class="save-btn2 u-reset-button"
						@tap="saveImage">{{ ['wxOfficialAccount', 'H5'].includes(platform) ? '长按图片保存' : '保存图片' }}</button>
					<!-- #endif -->
				</view>
			</view>
		</view>
		<!-- 分享tools -->
		<view class="cu-modal bottom-modal" :class="{ show: showShare }" @tap="showShare = false">
			<view class="cu-dialog " style="border-radius: 20rpx 20rpx 0 0;background: none;">
				<view class="share-box">
					<view class="share-list-box u-flex">
						<!-- #ifdef MP-WEIXIN -->
						<button class="share-item share-btn u-flex-col u-col-center" open-type="share">
							<image class="share-img" :src="$IMG_URL + '/imgs/share/share_wx.png'" mode=""></image>
							<text class="share-title">微信好友</text>
						</button>
						<!-- #endif -->
						<!-- #ifdef APP-PLUS || H5  -->
						<view class="share-item u-flex-col u-col-center" @tap="shareFriend" v-if="posterType=='goods'">
							<image class="share-img" :src="$IMG_URL + '/imgs/share/share_wx.png'" mode=""></image>
							<text class="share-title">微信好友</text>
						</view>
						<!-- #endif -->
						<view class="share-item u-flex-col u-col-center" @tap="onPoster" v-if="posterType=='user'">
							<image class="share-img" :src="$IMG_URL + '/imgs/share/share_poster.png'" mode=""></image>
							<text class="share-title">邀请好友</text>
						</view>

						<!-- <view class="share-item u-flex-col u-col-center" @tap="copySharePath">
							<image class="share-img" :src="$IMG_URL + '/imgs/share/share_link.png'" mode=""></image>
							<text class="share-title">复制链接</text>
						</view> -->
					</view>
					<view class="share-foot u-flex u-row-center u-col-center" @tap="showShare = false">取消</view>
				</view>
			</view>
		</view>
		<!-- 分享指引 -->
		<view class="cu-modal bottom-modal" :class="{ show: showShareGuide }" @tap="showShareGuide = false">
			<view class="cu-dialog"
				style="border-radius: 20rpx 20rpx 0 0;background: none;vertical-align: top;">
				<view class="guide-wrap u-flex u-col-top u-row-center">
					<image class="guide-img" :src="$IMG_URL + '/imgs/share/share_guide.png'" mode=""></image>
				</view>
			</view>
		</view>
		<!-- 各海报模块 -->
		<ljshop-canvas v-if="showPoster" ref="ljshopCanvas" :canvasParams="canvasParams"
			@success="onSuccess"></ljshop-canvas>
	</view>
</template>
<script>
	/**
	 * 分享弹窗
	 * @property {Boolean} value = showModal - v-model控制显隐
	 * @property {String} posterType - 海报类别
	 * @property {Object} posterInfo - 海报数据
	 */
	import {
		mapMutations,
		mapActions,
		mapState,
		mapGetters
	} from 'vuex';
	import Auth from '@/ljshop/permission/index.js';
	export default {
		name: 'ljshopShare',
		components: {},
		data() {
			return {
				showShareGuide: false, //H5的指引。
				showPoster: false, //海报弹窗
				platform: this.$platform.get(),
				posterImage: '',
				canvasParams: {},
				userinfo: uni.getStorageSync("userinfo"),
				InvitationCode: uni.getStorageSync("InvitationCode")

			};
		},
		props: {
			posterType: {
				type: String,
				default: ''
			},
			posterInfo: {
				type: Object,
				default: () => {}
			},
			value: {}
		},
		computed: {
			...mapGetters(['initShare', 'userInfo', 'isLogin', 'shareInfo']),
			showShare: {
				get() {
					return this.value;
				},
				set(val) {
					if (!this.showPoster) {
						// val ? uni.hideTabBar() : uni.showTabBar();
					}
					this.$emit('input', val);
				}
			}
		},

		created() {
			uni.$on('ON_WX_SHARE', () => {
				this.showShare = false;
			});
		},
		methods: {
			// 关闭弹窗
			onClosePoster() {
				this.showPoster = false;
			},
			// 绘制成功
			onSuccess(e) {

				this.posterImage = e;
			},
			// 开始绘制
			onPoster() {
				this.posterImage = '';
				uni.hideTabBar();
				if (uni.getStorageSync("UId")) {
					let platform = uni.getSystemInfoSync().platform

					if (platform == "android") {
						this.canvasParams = this.getPosterFormatter();
					} else {
						//this.canvasParams = this.getPosterFormatter();
						// #ifdef MP-WEIXIN  
						this.canvasParams = this.getwxIosPosterFormatter();
						// #endif
						// #ifdef APP-PLUS || H5
						this.canvasParams = this.getIosPosterFormatter();
						//console.info(platform)
						// #endif
					}

					this.showPoster = true;
				} else {

				}
				this.showShare = false;
			},
			// 分享好友
			shareFriend() {
				let that = this;
				// #ifdef APP-PLUS
				uni.share({
					provider: 'weixin',
					scene: 'WXSceneSession',
					type: 5,
					title: that.posterInfo.name,
					miniProgram: {
						id: "gh_74dbabd102eb",
						path: "/pages/goods/wxminidetail?InvitationCode=" + uni.getStorageSync("InvitationCode") +
							"&shareUId=" + uni.getStorageSync("UId") + "&productId=" + that.posterInfo.id,
						type: 0,
						webUrl: "https://www.hzwltb69.com/product/detail/" + that.posterInfo.id
					},
					imageUrl: that.posterInfo.thumbnail,

					success: res => {
						console.log('success:' + JSON.stringify(res));
						this.showShare = false;
					},
					fail: err => {
						console.log('fail:' + JSON.stringify(err));
					}
				});
				// #endif

				// #ifdef H5
				this.showShare = false;
				this.showShareGuide = true;
				// #endif
			},
			sharetoweixin() {
				let that = this;
				// #ifdef APP-PLUS
				uni.share({
					provider: 'weixin',
					scene: 'WXSceneSession',
					type: 2,
					imageUrl: that.posterImage,
					href: "",
					success: res => {
						console.log('success:' + JSON.stringify(res));
						this.showShare = false;
					},
					fail: err => {
						console.log('fail:' + JSON.stringify(err));
					}
				});
				// #endif


				// #ifdef H5
				this.showShare = false;
				this.showShareGuide = true;
				// #endif
			},

			// 保存图片
			async saveImage() {
				let that = this;
				if (['wxOfficialAccount', 'H5'].includes(this.platform)) {
					this.$u.toast('长按图片保存');
					return false;
				}
				let authState = await new Auth('writePhotosAlbum').check();
				if (authState) {
					uni.saveImageToPhotosAlbum({
						filePath: that.posterImage,
						success: res => {
							this.$u.toast('保存成功');
							this.showPoster = false;
						},
						fail: err => {
							console.log(`图片保存失败:`, err);
							this.$u.toast('保存失败');
						}
					});
				}
			},

			// 复制链接
			copySharePath() {
				let that = this;
				uni.setClipboardData({
					data: that.shareInfo.copyLink,
					success: data => {
						that.$u.toast('已复制到剪切板');
						that.showShare = false;
					}
				});
			},
			// 获取海报格式,规则说明在@/ljshop/poster/tools.js中的initDrawArray
			getPosterFormatter() {
				const that = this;
				let data = {};
			//	console.info(uni.getStorageSync("InvitationCode"))

				switch (this.posterType) {
					case 'user':

						data = {
							backgroundImage: "https://image.hzwltb69.com/app/images/invbackmini3.png",
							// backgroundImage: "https://image.hzwltb69.com/app/images/sharegoodsback.png",
							drawArray: [{
									name: 'backmini',
									type: 'image',
									url: "https://image.hzwltb69.com/app/images/backmin2.png",
									alpha: 1,
									dx: 190,
									dy: 1100,
									dWidth: 740,
									dHeight: 560,
								},
								{
									name: '用户昵称',
									type: 'text',
									text: uni.getStorageSync("mobile"),
									size: 36,
									dy: 1150,
									dx: 440,
									color: '#333',

								},
								{
									name: '用户昵称',
									type: 'text',
									text: "邀请码:" + uni.getStorageSync("InvitationCode"),
									size: 36,
									dy: 1200,
									dx: 440,
									color: '#333',

								},
								{
									name: 'avatar',
									type: 'image',
									url: "https://image.hzwltb69.com/app/images/logo.png",
									alpha: 1,
									dy: 1150,
									dx: 300,
									dWidth: 120,
									dHeight: 120,
									circleSet: {}
								},
								 
								{
									name: 'ewm',
									type: 'image',
									url: uni.getStorageSync("qcode"),
									size: 240,
									dx: 420,
									dy: 1320,
									dWidth: 280,
									dHeight: 280,
								},
							]
						};


						break;
					case 'goods':

						data = {

							backgroundImage: "https://image.hzwltb69.com/app/images/sharegoodsback.png",
							drawArray: [{
									name: 'avatar',
									type: 'image',
									url: "https://image.hzwltb69.com/app/images/logo.png",
									alpha: 1,
									dy: 40,
									dx: 38,
									dWidth: 80,
									dHeight: 80,
									circleSet: {}
								},
								{
									type: 'text',
									text: uni.getStorageSync("mobile"),
									size: 28,
									color: '#333',
									alpha: 1,
									textAlign: 'middle',
									textBaseline: 'bottom',
									dx: 140,
									dy: 40
								},
								{
									type: 'text',
									text: '推荐一个好物给你,请查收！',
									size: 26,
									color: '#333',
									alpha: 1,
									textAlign: 'middle',
									textBaseline: 'middle',
									dx: 140,
									dy: 80
								},
								{
									name: 'goodsImage',
									type: 'image',
									url: that.posterInfo.medium,
									alpha: 1,
									isBgCenter: true,
									dy: 140,
									dWidth: 620,
									dHeight: 620,
									roundRectSet: {
										r: 20
									}
								},
								{
									type: 'text', //标题
									text: that.posterInfo.name,
									size: 28,
									color: '#333',
									alpha: 1,
									textAlign: 'left',
									textBaseline: 'middle',
									fontWeight: 'bold',
									lineFeed: {
										maxWidth: 620,
										lineHeight: 40,
										lineNum: 2
									},
									dx: 36,
									dy: 780
								},
								{
									type: 'text',
									text: `￥${that.posterInfo.price}`,
									size: 38,
									color: '#E1212B',
									alpha: 1,
									textAlign: 'left',
									textBaseline: 'middle',
									fontWeight: 'bold',
									fontFamily: 'OPPOSANS',
									dx: 30,
									dy: 860
								},
								{
									type: 'text',
									text: `补贴￥${((that.posterInfo.price-that.posterInfo.cost)*that.posterInfo.rebate/100).toFixed(2)}`,
									size: 28,
									color: '#E1212B',
									alpha: 1,
									textAlign: 'left',
									textBaseline: 'top',
									dx: 400,
									dy: 860
								},


								{
									type: 'qrcode',
									text: `${that.$API_URL}?id=${that.posterInfo.id}&invcode=${ uni.getStorageSync("InvitationCode")}`,
									size: 110,
									dx: 530,
									dy: 930
								}

							]
						};

						break;

					default:
						console.log('%cerr:没有此类型海报数据', 'color:green;background:yellow');
						break;
				}
				return data;
			},
			
			getIosPosterFormatter(){
						const that = this;
						let data = {};
						
						
						switch (this.posterType) {
							case 'user': 
								data = {
							 	backgroundImage: "https://image.hzwltb69.com/app/images/invbackmin.png",
							      // backgroundImage: "https://image.hzwltb69.com/app/images/sharegoodsback.png",
									drawArray: [
										{
											name: 'back',
											type: 'image',
										    url:"https://image.hzwltb69.com/app/images/backmin.png",
											alpha: 1,
											isBgCenter: true,
											dy: 200,
											dWidth: 520,
											dHeight: 640,
										},
										{
											name: '用户昵称',
											type: 'text',
											text: uni.getStorageSync("mobile")  ,
											size: 24,
											dy: 200,
											dx: 190,
											color: '#333',
											
										},
										{
											name: '用户昵称',
											type: 'text',
											text: "邀请码:"+ uni.getStorageSync("InvitationCode"),
											size: 24,
											dy: 250,
											dx: 190,
											color: '#333',
											 
										},
										{
											name: 'avatar',
											type: 'image',
											url:"https://image.hzwltb69.com/app/images/logo.png",
											alpha: 1,
											dy: 220,
											dx: 90,
											dWidth: 90,
											dHeight: 90,
											circleSet: {}
										},
										{
											name: '普通二维码',
											type: 'qrcode',
											text: 'https://www.hzwltb69.com/member/register?_SPREAD='+uni.getStorageSync("InvitationCode"),
											size: 360,
											dy: 360,
											dWidth: 180,
											dHeight: 180,
											isBgCenter: true
										},
									 
									 
									]
								};
							
								break;
							case 'goods':
								
								data = {
									 
									backgroundImage: "https://image.hzwltb69.com/app/images/sharegoodsback.png",
									drawArray: [
										{
											name: 'avatar',
											type: 'image',
											url: "https://image.hzwltb69.com/app/images/logo.png",
											alpha: 1,
											dy: 40,
											dx: 38,
											dWidth: 80,
											dHeight: 80,
											circleSet: {}
										},
										{
											type: 'text',
											text: uni.getStorageSync("mobile") ,
											size: 28,
											color: '#333',
											alpha: 1,
											textAlign: 'middle',
											textBaseline: 'bottom',
											dx: 140,
											dy: 40
										},
										{
											type: 'text',
											text: '推荐一个好物给你,请查收！',
											size: 26,
											color: '#333',
											alpha: 1,
											textAlign: 'middle',
											textBaseline: 'middle',
											dx: 140,
											dy: 80
										},
										{
											name: 'goodsImage',
											type: 'image',
											url: that.posterInfo.medium,
											alpha: 1,
											isBgCenter: true,
											dy: 140,
											dWidth: 620,
											dHeight: 620,
											roundRectSet: {
												r: 20
											}
										},
										{
											type: 'text', //标题
											text: that.posterInfo.name,
											size: 28,
											color: '#333',
											alpha: 1,
											textAlign: 'left',
											textBaseline: 'middle',
											fontWeight: 'bold',
											lineFeed: {
												maxWidth: 620,
												lineHeight: 40,
												lineNum: 2
											},
											dx: 36,
											dy: 780
										},
										{
											type: 'text',
											text: `￥${that.posterInfo.price}`,
											size: 38,
											color: '#E1212B',
											alpha: 1,
											textAlign: 'left',
											textBaseline: 'middle',
											fontWeight: 'bold',
											fontFamily: 'OPPOSANS',
											dx: 30,
											dy: 860
										},
										{
											type: 'text',
											text: `补贴￥${((that.posterInfo.price-that.posterInfo.cost)*that.posterInfo.rebate/100).toFixed(2)}`,
											size: 28,
											color: '#E1212B',
											alpha: 1,
											textAlign: 'left',
											textBaseline: 'top',
											dx: 400,
											dy: 860
										},
										 
										 
										{
											type: 'qrcode',
											text:`${that.$API_URL}?id=${that.posterInfo.id}&invcode=${uni.getStorageSync("InvitationCode")}`,
											size: 110,
											dx: 530,
											dy: 930
										}
									 
									]
								};
								
								break;
							case 'groupon':
								data = {
									backgroundImage: that.initShare.groupon_poster_bg,
									drawArray: [
										{
											name: 'avatar',
											type: 'image',
											url: that.userInfo.avatar,
											alpha: 1,
											dy: 40,
											dx: 38,
											dWidth: 80,
											dHeight: 80,
											circleSet: {}
										},
										{
											type: 'text',
											text: that.userInfo.nickname,
											size: 28,
											color: '#333',
											alpha: 1,
											textAlign: 'middle',
											textBaseline: 'bottom',
											dx: 140,
											dy: 40
										},
										{
											type: 'text',
											text: '发现一个好物，快来和我一起拼吧！',
											size: 26,
											color: '#333',
											alpha: 1,
											textAlign: 'middle',
											textBaseline: 'middle',
											dx: 140,
											dy: 80
										},
										{
											name: 'goodsImage',
											type: 'image',
											url: that.posterInfo.goods.image,
											alpha: 1,
											isBgCenter: true,
											dy: 140,
											dWidth: 620,
											dHeight: 620,
											roundRectSet: {
												r: 20
											}
										},
										{
											type: 'text', //标题
											text: that.posterInfo.goods.title,
											size: 28,
											color: '#333',
											alpha: 1,
											textAlign: 'left',
											textBaseline: 'middle',
											fontWeight: 'bold',
											lineFeed: {
												maxWidth: 620,
												lineHeight: 40,
												lineNum: 2
											},
											dx: 36,
											dy: 780
										},
										{
											type: 'text',
											text: `拼团价：￥${that.posterInfo.goods.groupon_price}`,
											size: 32,
											color: '#E1212B',
											alpha: 1,
											textAlign: 'left',
											textBaseline: 'middle',
											fontWeight: 'bold',
											fontFamily: 'OPPOSANS',
											dx: 30,
											dy: 860
										},
										{
											type: 'text',
											text: `${that.posterInfo.num}人团`,
											size: 24,
											color: '#fff',
											alpha: 1,
											textAlign: 'left',
											textBaseline: 'top',
											dx: 565,
											dy: 863
										},
										// #ifdef MP-WEIXIN
										{
											name: 'wxCode',
											type: 'image', //微信小程序码
											url: `${that.$API_URL}wechat/wxacode?scene=${that.shareInfo.query}`,
											alpha: 1,
											dx: 530,
											dy: 930,
											dWidth: 110,
											dHeight: 110
										},
										// #endif
										// #ifndef MP-WEIXIN
										{
											type: 'qrcode',
											text: that.shareInfo.path,
											size: 110,
											dx: 530,
											dy: 930
										}
										// #endif
									]
								};
								break;
							default:
								console.log('%cerr:没有此类型海报数据', 'color:green;background:yellow');
								break;
						}
						return data;
				},
			getwxIosPosterFormatter() {
				const that = this;
				let data = {};

				//console.info(uni.getStorageSync("InvitationCode"))
				switch (this.posterType) {
					case 'user':

						data = {
							backgroundImage: "https://image.hzwltb69.com/app/images/invbackmini3.png",
							// backgroundImage: "https://image.hzwltb69.com/app/images/sharegoodsback.png",
							drawArray: [

								{
									name: 'backmini',
									type: 'image',
									url: "https://image.hzwltb69.com/app/images/backmin2.png",
									alpha: 1,
									dx: 190,
									dy: 1100,
									dWidth: 740,
									dHeight: 560,
								},
								{
									name: '用户昵称',
									type: 'text',
									text: uni.getStorageSync("mobile"),
									size: 36,
									dy: 1150,
									dx: 440,
									color: '#333',

								},
								{
									name: '用户昵称',
									type: 'text',
									text: "邀请码:" + uni.getStorageSync("InvitationCode"),
									size: 36,
									dy: 1200,
									dx: 440,
									color: '#333',
								},
								{
									name: 'avatar',
									type: 'image',
									url: "https://image.hzwltb69.com/app/images/logo.png",
									alpha: 1,
									dy: 1150,
									dx: 300,
									dWidth: 120,
									dHeight: 120,
									circleSet: {}
								},

								{
									name: 'ewm',
									type: 'image',
									url: uni.getStorageSync("qcode"),
									size: 240,
									dx: 420,
									dy: 1320,
									dWidth: 280,
									dHeight: 280,
								},

							]
						};

						break;
					case 'goods':
						data = {
							backgroundImage: "https://image.hzwltb69.com/app/images/sharegoodsback.png",
							drawArray: [{
									name: 'avatar',
									type: 'image',
									url: "https://image.hzwltb69.com/app/images/logo.png",
									alpha: 1,
									dy: 40,
									dx: 38,
									dWidth: 80,
									dHeight: 80,
									circleSet: {}
								},
								{
									type: 'text',
									text: uni.getStorageSync("mobile"),
									size: 28,
									color: '#333',
									alpha: 1,
									textAlign: 'middle',
									textBaseline: 'bottom',
									dx: 140,
									dy: 40
								},
								{
									type: 'text',
									text: '推荐一个好物给你,请查收！',
									size: 26,
									color: '#333',
									alpha: 1,
									textAlign: 'middle',
									textBaseline: 'middle',
									dx: 140,
									dy: 80
								},
								{
									name: 'goodsImage',
									type: 'image',
									url: that.posterInfo.medium,
									alpha: 1,
									isBgCenter: true,
									dy: 140,
									dWidth: 620,
									dHeight: 620,
									roundRectSet: {
										r: 20
									}
								},
								{
									type: 'text', //标题
									text: that.posterInfo.name,
									size: 28,
									color: '#333',
									alpha: 1,
									textAlign: 'left',
									textBaseline: 'middle',
									fontWeight: 'bold',
									lineFeed: {
										maxWidth: 620,
										lineHeight: 40,
										lineNum: 2
									},
									dx: 36,
									dy: 780
								},
								{
									type: 'text',
									text: `￥${that.posterInfo.price}`,
									size: 38,
									color: '#E1212B',
									alpha: 1,
									textAlign: 'left',
									textBaseline: 'middle',
									fontWeight: 'bold',
									fontFamily: 'OPPOSANS',
									dx: 30,
									dy: 860
								},
								{
									type: 'text',
									text: `补贴￥${((that.posterInfo.price-that.posterInfo.cost)*that.posterInfo.rebate/100).toFixed(2)}`,
									size: 28,
									color: '#E1212B',
									alpha: 1,
									textAlign: 'left',
									textBaseline: 'top',
									dx: 400,
									dy: 860
								},


								{
									type: 'qrcode',
									text: `${that.$API_URL}?id=${that.posterInfo.id}&invcode=${uni.getStorageSync("InvitationCode")}`,
									size: 110,
									dx: 530,
									dy: 930
								}

							]
						};

						break;
					case 'groupon':
						data = {
							backgroundImage: that.initShare.groupon_poster_bg,
							drawArray: [{
									name: 'avatar',
									type: 'image',
									url: that.userInfo.avatar,
									alpha: 1,
									dy: 40,
									dx: 38,
									dWidth: 80,
									dHeight: 80,
									circleSet: {}
								},
								{
									type: 'text',
									text: that.userInfo.nickname,
									size: 28,
									color: '#333',
									alpha: 1,
									textAlign: 'middle',
									textBaseline: 'bottom',
									dx: 140,
									dy: 40
								},
								{
									type: 'text',
									text: '发现一个好物，快来和我一起拼吧！',
									size: 26,
									color: '#333',
									alpha: 1,
									textAlign: 'middle',
									textBaseline: 'middle',
									dx: 140,
									dy: 80
								},
								{
									name: 'goodsImage',
									type: 'image',
									url: that.posterInfo.goods.image,
									alpha: 1,
									isBgCenter: true,
									dy: 140,
									dWidth: 620,
									dHeight: 620,
									roundRectSet: {
										r: 20
									}
								},
								{
									type: 'text', //标题
									text: that.posterInfo.goods.title,
									size: 28,
									color: '#333',
									alpha: 1,
									textAlign: 'left',
									textBaseline: 'middle',
									fontWeight: 'bold',
									lineFeed: {
										maxWidth: 620,
										lineHeight: 40,
										lineNum: 2
									},
									dx: 36,
									dy: 780
								},
								{
									type: 'text',
									text: `拼团价：￥${that.posterInfo.goods.groupon_price}`,
									size: 32,
									color: '#E1212B',
									alpha: 1,
									textAlign: 'left',
									textBaseline: 'middle',
									fontWeight: 'bold',
									fontFamily: 'OPPOSANS',
									dx: 30,
									dy: 860
								},
								{
									type: 'text',
									text: `${that.posterInfo.num}人团`,
									size: 24,
									color: '#fff',
									alpha: 1,
									textAlign: 'left',
									textBaseline: 'top',
									dx: 565,
									dy: 863
								},
								// #ifdef MP-WEIXIN
								{
									name: 'wxCode',
									type: 'image', //微信小程序码
									url: `${that.$API_URL}wechat/wxacode?scene=${that.shareInfo.query}`,
									alpha: 1,
									dx: 530,
									dy: 930,
									dWidth: 110,
									dHeight: 110
								},
								// #endif
								// #ifndef MP-WEIXIN
								{
									type: 'qrcode',
									text: that.shareInfo.path,
									size: 110,
									dx: 530,
									dy: 930
								}
								// #endif
							]
						};
						break;
					default:
						console.log('%cerr:没有此类型海报数据', 'color:green;background:yellow');
						break;
				}
				return data;
			}
		}
	};
</script>

<style lang="scss">
	// 指引
	.guide-wrap {
		height: 100%;

		.guide-img {
			width: 580rpx;
			height: 430rpx;
		}
	}

	// 分享海报
	.poster-btn-box {
		.cancel-btn {
			width: 240rpx;
			height: 70rpx;
			line-height: 70rpx;
			background: #ffffff;
			border-radius: 35rpx;
			font-size: 28rpx;
			margin-left: 60rpx;
			font-weight: 500;
			color: #999999;
			 
		}

		.save-btn {
			width: 240rpx;
			height: 70rpx;
			line-height: 70rpx;
			background: linear-gradient(90deg, #e9b461, #eecc89);
			border-radius: 35rpx;
			font-size: 28rpx;
			font-weight: 500;
			margin-right: 60rpx;
			color: #ffffff;
			
		}

		.save-btn2 {
			width: 580rpx;
			height: 70rpx;
			line-height: 70rpx;
			background: linear-gradient(90deg, #e9b461, #eecc89);
			border-radius: 35rpx;
			font-size: 28rpx;
			font-weight: 500;
			color: #ffffff;
			margin-left: 60rpx;
			margin-right: 60rpx;
			
		}
	}

	.poster-img-box {
		.poster-img {

			min-height: 800rpx;
			border-radius: 20rpx;
		}
	}

	// 分享tool
	.share-box {
		background: #fff;
		width: 750rpx;
		border-radius: 30rpx 30rpx 0 0;
		padding-top: 30rpx;
		position: relative;

		.share-foot {
			font-size: 24rpx;
			color: #bfbfbf;
			height: 80rpx;
			border-top: 1rpx solid #eee;
		}

		.share-list-box {
			.share-btn {
				background: none;
				border: none;
				line-height: 1;
				padding: 0;

				&::after {
					border: none;
				}
			}

			.share-item {
				flex: 1;
				padding-bottom: 20rpx;

				.share-img {
					width: 70rpx;
					height: 70rpx;
					background: rgba(246, 246, 254, 1);
					border-radius: 50%;
					margin-bottom: 20rpx;
				}

				.share-title {
					font-size: 24rpx;
					color: #666;
				}
			}
		}
	}
</style>